import java.util.ArrayList;
import java.util.Scanner;

public class Actions {

	private Student mass[];
	private ArrayList<Student> listStudents;
	Scanner sc = new Scanner (System.in);
	Scanner cs = new Scanner (System.in);
	Student student = new Student();
	public Actions() {
		mass = new Student[16];
		mass[0] = new Student(1, "Dmitry", "Minaev", "MF", 2, 1);
		mass[1] = new Student(2, "Lilia", "Rolka", "BF", 1, 2);
		mass[2] = new Student(3, "Ekaterina", "Awesome", "BF", 3, 4);
		mass[3] = new Student(4, "Andrey", "Awesome", "MF", 4, 2);
		mass[4] = new Student(5, "Kris", "Lambert", "GF", 1, 3);
		mass[5] = new Student(6, "Aleksey", "Bondarenko", "GF", 2, 4);
		mass[6] = new Student(7, "Pavel", "Gorbach", "GF", 3, 2);
		mass[7] = new Student(8, "Vadim", "Danilovich", "BF", 2, 1);
		mass[8] = new Student(9, "Kasia", "Ulasovich", "BF", 4, 1);
		mass[9] = new Student(10, "Andrey", "Popko", "GF", 4, 4);
		mass[10] = new Student(11, "Vera", "Reut", "MF", 1, 2);
		mass[11] = new Student(12, "Till", "Himmelstein", "MF", 3, 3);
		mass[12] = new Student(13, "Anton", "Verishko", "MF", 5, 3);
		mass[13] = new Student(14, "Evgeni", "Danilchik", "BF", 5, 1);
		mass[14] = new Student(15, "Maksim", "Margish", "GF", 5, 3);
		mass[15] = new Student(15, "Maksim", "Margish", "MF", 3, 3);
	}

	public void show() {
		for (int i = 0; i < mass.length; i++) {
			System.out.println(mass[i]);
		}

	}

	public ArrayList<Student> getListStudentsOfFaculity() {
		listStudents = new ArrayList<>();
		for (Student student : mass) {
			if (student.getFaculity() == "MF") {
				listStudents.add(student);
			}
		}
		return listStudents;
	}
	public void getListStudentOfFaclityAndKurs(){
		System.out.println("Enter fakulty and kurs");
		String faculity =sc.nextLine();
		int kurs = sc.nextInt();
		for (Student student : mass) {
			
			while (student.getFaculity().equals(faculity)&& student.getKurs() == kurs) {
				System.out.println(student);break;

			}
			
			}
		}
	 
	
	
	public void getListStudentOfGroup(){
		System.out.println("Enter faculty and group");
		String faculity =cs.nextLine();
		int group = cs.nextInt();
		for (Student student : mass) {
			
			while (student.getFaculity().equals(faculity)&& student.getGroup() == group) {
				System.out.println(student);break;

			}
			
			}
		}
	}
